#ifndef prs_GrfRect_H
#define prs_GrfRect_H

#include "grf.h"
#include "sntText.h"

namespace prs {

///////////////////////////////////////////////////////////////////////////////

struct TRuleGrfRect : public snt::TRule
{
  TRuleGrfRect(snt::text::TContext &Context,svl::TVariant &VRect);
  //
private:
  static TRuleGrfRect &GetThis(svl::TVariant &VThis) { return *dynamic_cast<TRuleGrfRect*>(VThis.Pointer()); }
  grf::TRect &GetRect();
  //
  static void FLeft  (snt::TParams &Params) { GetThis(Params[0]).GetRect().Left   = Params[1]; }
  static void FTop   (snt::TParams &Params) { GetThis(Params[0]).GetRect().Top    = Params[1]; }
  static void FWidth (snt::TParams &Params) { GetThis(Params[0]).GetRect().Width  = Params[1]; }
  static void FHeight(snt::TParams &Params) { GetThis(Params[0]).GetRect().Height = Params[1]; }
  //
  svl::TVariant &vRect,vThis,vNumber;
  snt::TAlter A;
  svl_Except;
};

///////////////////////////////////////////////////////////////////////////////
}

#endif
